package List;

import java.util.Enumeration;
import java.util.Iterator;
import java.util.Vector;

public class VectorDemo {
    public static void main(String[] args) {
        Vector v = new Vector();
        v.addElement("黑旋风");
        v.addElement("刘德华");
        v.addElement("成龙");
        v.addElement("李连杰");
        for (Iterator it = v.iterator(); it.hasNext();)
        {
            //获取集合里面的数据
            System.out.println(it.next());
        }
        for (Enumeration en = v.elements(); en.hasMoreElements();) {
            //输出集合中的数据
            System.out.println(en.nextElement());
        }
    }
}
